﻿using System;
class VariableChange
{
    static void Main()
    {
        int inputChoice = 0;
        int number;
        string anything;
        double numberD;
        do
        {
            if (inputChoice != 0)
            {
                Console.Write("Please reenter number: ");
            }
            else
            {
                Console.Write("Please enter 0 for int, 1 for double 2 for string: ");
            }
            while (true)
            {
                try
                {
                    inputChoice = int.Parse(Console.ReadLine());
                    break;
                }
                catch (Exception)
                {
                    Console.Write("Please reenter number: ");
                }
            }
        } while ((inputChoice < 0) || (inputChoice > 2));
        switch (inputChoice)
        {
            case 0:
                {
                    Console.Write("Please input integer: ");
                    while (true)
                    {
                        try
                        {
                            number = int.Parse(Console.ReadLine());
                            break;
                        }
                        catch (Exception)
                        {
                            Console.Write("Please reenter number: ");
                        }
                    }
                    Console.WriteLine("number is {0} + 1 = {1}", number, (number + 1));
                    break;
                }
            case 1:
                {
                    {
                        Console.Write("Please input double: ");
                        while (true)
                        {
                            try
                            {
                                numberD = double.Parse(Console.ReadLine());
                                break;
                            }
                            catch (Exception)
                            {
                                Console.Write("Please reenter number: ");
                            }
                        }
                        Console.WriteLine("number is {0} + 1 = {1}", numberD, (numberD + 1));
                        break;
                    }
                    break;
                }
            case 2:
                {
                    Console.Write("Please input anything: ");
                    anything = Console.ReadLine();
                    Console.WriteLine("result is: {0}", anything + "*");
                    break;
                }
            default:
                {
                    break;
                }
        }
        Console.ReadLine();
    }
}


